﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SimpleNoteLib.Config;
using SimpleNoteLib.HttpRequests;

namespace SimpleNoteLib.ApiRequests
{
    internal class GetNoteRequest : HttpGetRequest
    {
        public string Key { get; set; }
        public string Email { get; set; }
        public string Token { get; set; }

        public GetNoteRequest(string key)
        {
            Key = key;
            Email = Login.Email;
            Token = Login.Token;
        }

        private void SetAddress()
        {
            string address = string.Format("{0}data/{1}?auth={2}&email={3}", SimpleNoteApiConfig.ApiAddress, Key, Token, Email);
            Address = address;
        }

        public override string SendAndGetResponse()
        {
            SetAddress();
            return base.SendAndGetResponse();
        }
    }
}
